package mall.pojo;


public class Item {
	private int productid;
	private String name;
	private float price;
	private int quantity;
	private String picture;
	private boolean available=true;
	private float total;
	
	
	public int getProductid() {
		return productid;
	}
	public void setProductid(int productid) {
		this.productid = productid;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public float getPrice() {
		return price;
	}
	public void setPrice(float price) {
		this.price = price;
	}
	public String getPicture() {
		return picture;
	}
	public void setPicture(String picture) {
		this.picture = picture;
	}
	public float getTotal() {
		return total;
	}
	public void setTotal(float total) {
		this.total = total;
	}
	public Item(int productid, String name, float price,int quantity,String picture,float total) {
		super();
		this.productid = productid;
		this.name = name;
		this.price = price;
		this.quantity=quantity;
		this.picture=picture;
		this.total=total;
	}
	public Item() {
		super();
	}
	public int getQuantity() {
		return quantity;
	}
	public void setQuantity(int quantity) {
		this.quantity = quantity;
	}
	
	
	public boolean isAvailable() {
		return available;
	}
	public void setAvailable(boolean available) {
		this.available = available;
	}
	// overide to compare 2 item object by productid
	@Override
	public boolean equals(Object obj) {
		if (!(obj instanceof Item)) {
	        return false;
	    }
		Item item1=(Item)obj;	
		return this.productid == item1.productid;
	}
	
	
}
